<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<%@ include file="header.jsp"%>
	<link rel="stylesheet" href="/static/layui/css/layui.css"/>
	<script type="text/javascript" src="/static/layui/layui.js"></script>
	<title>主页</title>
</head>
<body class="layui-layout-body">
	<div class="layui-layout layui-layout-admin">
		<div class="layui-header">
			<div class="layui-logo">物料管理系统</div>
			<ul class="layui-nav layui-layout-left">   </ul>
			<ul class="layui-nav layui-layout-right">
				<li class="layui-nav-item">
				    <a href="javascript:;"> 
<%-- 				        <img src="<%=path%>/img/fei.png" --%>
<!-- 				        class="layui-nav-img"/> -->
							<%--<shiro:principal/>用户主身份信息--%>
				        	用户<shiro:principal/>
<%-- 				        	[${user.name}] --%>
				    </a>
					<dl class="layui-nav-child">
						<dd>
							<a href="${path}/user/getUserInfoPage">基本资料</a>
						</dd>
						<dd>
							<a href="${path}/user/getUserUpdatePasswordPage">修改密码</a>
						</dd>

					</dl>
				</li>
				<li class="layui-nav-item">
				    <a href="javascript:logout()">注销</a>
				</li>
			</ul>
		</div>
		<div class="layui-side layui-bg-black">
			<div class="layui-side-scroll">
				<!-- 左侧导航区域（可配合layui已有的垂直导航） -->
				<ul class="layui-nav layui-nav-tree" >
					<li class="layui-nav-item layui-nav-itemed" >
					    <a href="javascript:;" onclick="display()">管理类型</a>
						<dl id="managerInfo"  >
							<shiro:hasPermission name="/material/list">
								<dd>
									<a href="javascript:;"
									   data-url="/material/getMaterialListPage"
									   class="site-demo-active">物料管理</a>
								</dd>
							</shiro:hasPermission>
							<shiro:hasPermission name="/user/list">
								<dd>
									<a href="javascript:;"
									   data-url="/user/getUserListPage"
									   class="site-demo-active">用户管理</a>
								</dd>
							</shiro:hasPermission>
							<shiro:hasPermission name="/role/list">
								<dd>
									<a href="javascript:;"
									   data-url="/role/getRoleListPage"
									   class="site-demo-active">角色管理</a>
								</dd>
							</shiro:hasPermission>
							<shiro:hasPermission name="/permission/list">
								<dd>
									<a href="javascript:;"
									   data-url="/permission/getPermissionListPage"
									   class="site-demo-active">权限管理</a>
								</dd>
							</shiro:hasPermission>
							<shiro:hasPermission name="/production/list">
								<dd>
									<a href="javascript:;"
									   data-url="/production/getProductionListPage"
									   class="site-demo-active">产品管理</a>
								</dd>
							</shiro:hasPermission>
							<shiro:hasPermission name="/supplier/list">
								<dd>
									<a href="javascript:;"
									   data-url="/supplier/getSupplierListPage"
									   class="site-demo-active">供应商管理</a>
								</dd>
							</shiro:hasPermission>
							<shiro:hasPermission name="/repository/list">
								<dd>
									<a href="javascript:;"
									   data-url="/repository/getRepositoryListPage"
									   class="site-demo-active">仓库管理</a>
								</dd>
							</shiro:hasPermission>
							<shiro:hasPermission name="/type/list">
								<dd>
									<a href="javascript:;"
									   data-url="/type/getTypeListPage"
									   class="site-demo-active">类型管理</a>
								</dd>
							</shiro:hasPermission>
							<shiro:hasPermission name="/input/list">
								<dd>
									<a href="javascript:;"
									   data-url="/input/getInputListPage"
									   class="site-demo-active">入库管理</a>
								</dd>
							</shiro:hasPermission>
							<shiro:hasPermission name="/output/list">
								<dd>
									<a href="javascript:;"
									   data-url="/output/getOutputListPage"
									   class="site-demo-active">出库管理</a>
								</dd>
							</shiro:hasPermission>
							<shiro:hasPermission name="/manufacture/list">
								<dd>
									<a href="javascript:;"
									   data-url="/manufacture/getManufactureListPage"
									   class="site-demo-active">生产管理</a>
								</dd>
							</shiro:hasPermission>
							<shiro:hasPermission name="/buyorder/list">
								<dd>
									<a href="javascript:;"
									   data-url="/buyOrder/getBuyOrderListPage"
									   class="site-demo-active">订单管理</a>
								</dd>
							</shiro:hasPermission>
						</dl>
					</li>
				</ul>
			</div>
		</div>
		<div class="layui-body"><!-- 内容主体区域 -->
			<iframe name="rightframe" width="99%" height="97%" style="background-color: #00F7DE" ></iframe>
		</div>
		<div class="layui-footer"></div>
	</div>
	<script type="text/javascript">
		var $ = layui.jquery;
		var layer = layui.layer;
		var element = layui.element;
		$('.site-demo-active').click(function() {
			window.open($(this).data('url'), "rightframe");
		});
		element.render();// element.init();
		function openURL(url){
			window.open('${path}' + url, "rightframe");
		}

		function logout() {
			layer.confirm(
					'您确认要退出么',
					{icon:3},
					function() {
						location.href = '${path}/user/logout'
					}
			);
		}
        function display() {
			$('#managerInfo').toggleClass('display_none');
		}
	</script>
</body>
</html>